package com.quanxiaoha.framework.common.validator;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.METHOD, ElementType.FIELD,ElementType.ANNOTATION_TYPE,ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = PhoneNumberValidator.class)//该注解使用验证器PhoneNumberValidator，而不是验证器使用注解
public @interface PhoneNumber {
    String message() default "手机号码格式错误,需要11位数字";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default{};
}
